package com.kgc.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultMapUtils {

    public String code;
    public String msg;
    public Object data;

    public static ResultMapUtils SUCCESS(Object data){
        return new ResultMapUtils(ConfigUtills.SUCCESS_CODE,ConfigUtills.SUCCESS_MSG,data);
    }

    public static ResultMapUtils SUCCESS(String msg, Object data){
        return new ResultMapUtils(ConfigUtills.SUCCESS_CODE,ConfigUtills.SUCCESS_MSG,data);
    }

    public static ResultMapUtils SUCCESS(String msg){
        return new ResultMapUtils(ConfigUtills.SUCCESS_CODE,ConfigUtills.SUCCESS_MSG,null);
    }

    public static ResultMapUtils SUCCESS_TABLE_DATA(Object data){
        return new ResultMapUtils("0",ConfigUtills.SUCCESS_MSG,data);
    }

    public static ResultMapUtils ERROR(String code, String msg){
        return new ResultMapUtils(code,msg,null);
    }

}
